﻿<view:BaseView x:Class="ModernUILogViewer.Content.ContentTestFile"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:sys="clr-namespace:System;assembly=mscorlib"
             xmlns:mui="http://firstfloorsoftware.com/ModernUI"
             xmlns:view="clr-namespace:ModernUILogViewer.View"
             xmlns:conv="clr-namespace:ModernUILogViewer.Converters"
             xmlns:helper="clr-namespace:ModernUILogViewer.Elements.Helpers"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"                
             xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions"                         
             xmlns:validation="clr-namespace:ModernUILogViewer.Validation"
             mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="300"             
             >

    <UserControl.Resources>
        <conv:NullToBooleanConverter x:Key="nulltobooleanconverter" />
        <conv:FilenameConverter x:Key="fileconverter" />
    </UserControl.Resources>

    <!--<Border HorizontalAlignment="Stretch" BorderBrush="{DynamicResource ButtonBorder}" BorderThickness="1" Margin="8, 0, 0, 0" DockPanel.Dock="Right" MinWidth="200">-->
    <DockPanel>
        <StackPanel MinWidth="100" DockPanel.Dock="Top">
            <TextBlock Text="REGEX PATTERN" Style="{StaticResource Heading2}" Margin="{StaticResource DefaultTopMargin}" />

            <TextBox Margin="{StaticResource DefaultTopMargin}"
                helper:TextChangedCommandDelay.Command="{Binding ProcessRegex}"     
                helper:TextChangedCommandDelay.Delay="1.5"
                >
                <TextBox.Text>
                    <Binding Path="RegexPattern" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
                        <Binding.ValidationRules>
                            <validation:RegexValidation />
                        </Binding.ValidationRules>
                    </Binding>
                </TextBox.Text>
            </TextBox>

            <TextBlock Text="REGEX RESULT" Style="{StaticResource Heading2}" Margin="{StaticResource DefaultTopMargin}" />
            <TextBox
                DockPanel.Dock="Top"  
                IsReadOnly="True"
                HorizontalScrollBarVisibility="Auto" 
                VerticalScrollBarVisibility="Auto" 
                Margin="{StaticResource DefaultTopMargin}" 
                TextWrapping="Wrap"
                Height="100"
                Text="{Binding ResultRegex, Mode=OneWay}"
                
            />
            <TextBlock Text="CONTENT" Style="{StaticResource Heading2}" Margin="{StaticResource DefaultTopMargin}" />
        </StackPanel>

        <TextBox
                DockPanel.Dock="Bottom"
                Margin="0, 8, 0, 4"            
                HorizontalScrollBarVisibility="Auto" 
                VerticalScrollBarVisibility="Auto" 
                IsReadOnly="False" 
                Text="{Binding InputRegex, UpdateSourceTrigger=PropertyChanged}"                             
                x:Name="txtbox"
                helper:TextChangedCommandDelay.Command="{Binding ProcessRegex}"
                helper:TextChangedCommandDelay.Delay="1.5"
            />
    </DockPanel>

    <!--</Border>-->

</view:BaseView>
